3D Head Visualizations¶
3D topographic head map¶
The 3D topographic head map provides a view of voltage measurements as a heatmap imposed on a 3D skull shape. It can be generated as an animation to view changes over time or as a standalone plot.

General Setup¶
Import required modules¶
from simpl_eeg import topomap_3d_head, eeg_objects
import warnings
warnings.filterwarnings('ignore')
Note
Please include the line below in your IDE so that the changes would be simultaneously reflected when you make a change to the python scripts.
%load_ext autoreload
%autoreload 2
Create epoched data¶
For additional options see Creating EEG Objects section.
experiment_folder = "../../data/927"
nth_epoch = 0
epochs = eeg_objects.Epochs(experiment_folder)
epoch = epochs.get_nth_epoch(nth_epoch)
Reading /Users/mpin/Documents/MDS/capstone/simpl_eeg_capstone/data/927/fixica.fdt
Not setting metadata
Not setting metadata
33 matching events found
Setting baseline interval to [-0.2998046875, 0.0] sec
Applying baseline correction (mode: mean)
0 projection items activated
Loading data for 33 events and 2049 original time points ...
0 bad epochs dropped
Create a 3D topographic animation¶
Define parameters¶
A detailed description of all parameters can be found in the topomap_3d_head.animate_3d_head docstring:
help(topomap_3d_head.animate_3d_head)
Help on function animate_3d_head in module simpl_eeg.topomap_3d_head:
animate_3d_head(epoch, plot_title='', color_title='EEG MicroVolt', color_min=-50, color_max=50, colormap='Bluered')
Plot an animated topographic map in a 3D head shape
Parameters:
epoch: mne.epochs.Epochs
An epoched file for the EEGLab data
plot_title: str (optional)
The title of the plot. Defaults to "".
color_title: str (optional)
The title of the color bar. Defaults to "EEG MicroVolt".
color_min: int (optional)
The minimum EEG voltage value to be shown on the color bar.
Defaults to -50.
color_max: int (optional)
The maximum EEG voltage value to be shown on the color bar.
Defaults to 50.
colormap: str (optional)
The colour scheme to use. Defaults to Bluered.
Returns:
plotly.graph_objs._figure.Figure:
An animated topographic map in a 3D head shape
color_min = -40
color_max = 40
colormap = "RdBu_r"
time_stamp = -300
Generating the animation¶
topo_3d_head = topomap_3d_head.animate_3d_head(
epoch,
color_title="EEG MicroVolt",
color_min=color_min,
color_max=color_max,
colormap=colormap,
)
topo_3d_head.show()